<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>28.ES5的继承</title>
</head>
<body>

<script>
  function Phone(brand,price){
      this.brand = brand
      this.price = price
  }

  Phone.prototype.call = function (){
      console.log('打电话')
  }

  function SmartPhone(brand, price, color, size) {
      Phone.call(this,brand,price)
      this.color = color
      this.size = size
  }

  SmartPhone.prototype = new Phone()
  SmartPhone.prototype.constructor = SmartPhone

  SmartPhone.prototype.photo = function () {
      console.log('我可以拍照')
  }
  
  let sp = new SmartPhone('huawei',5999,'golden','6.0ins')
  console.log(sp)
  sp.call()
  sp.photo()
</script>
</body>
</html>